Software Development
Defensive Programming in Android
Defensive Programming in Android: Errors, Exceptions, and Testing
Defensive Programming in Android: Input and Methods
Defensive Programming in Android: Network Access and Java Defensive Techniques
Defensive Programming in Android: Using Standards

Defensive Programming in Android: Errors, Exceptions, and Testing

Course Number:
sd_dpfa_a03_it_enus
Lesson Objectives

Defensive Programming in Android: Errors, Exceptions, and Testing

  • start the course
  • recognize how errors and exceptions can be used in defensive programming
  • use the Java exception classes
  • use exception stack traces
  • test for specific kinds of errors based on domain and code
  • create custom Java error classes
  • inform end users of error information in an Android app
  • use an underlying error object to find out more detail about an error that has occurred
  • release Java resources in the event of an exception
  • recognize how unit testing can be used in defensive programming
  • use the android testing API to construct automated unit tests
  • use instrumentation in automated Android unit testing
  • use test case classes in Android automated unit testing
  • use Android assertion classes
  • use mock object classes in Android automated unit testing
  • use test runner classes for Android automated unit testing
  • view test results in the IDE
  • recognize where end-to-end testing can be used in defensive programming
  • set up the Android Testing Support API for automated UI testing
  • use Espresso test classes for Android automated UI testing
  • use instrumentation of activities for Android automated UI testing
  • test UI components in Android
  • use ViewAction, ViewInteraction, and DataInteraction classes to simulate actions when testing an Android app
  • describe the use of assertions for defensive programming in Java for Android
  • use basic assert statements in Java for Android
  • identify and use precondition, postcondition and invariant assertions
  • use annotations to aid in programming defensively for Android
  • create a Java app to use exceptions and assertions

Overview/Description
Defensive Programming in Android uses coding practices and techniques to create apps that are reliable, resilient, and easily testable. This course will teach you about thinking defensively in your approach to errors and exception handling, and also how to create automated tests for Android apps.

Target Audience
Android developers who have experience creating apps using Java, and who want to employ defensive programming techniques

Defensive Programming in Android: Input and Methods

Course Number:
sd_dpfa_a01_it_enus
Lesson Objectives

Defensive Programming in Android: Input and Methods

  • start the course
  • identify common assumptions not to make about user input
  • create code that handles file inputs to an Android app
  • create code that handles URL inputs to an Android app
  • validate user-provided input
  • use a real-time approach to validating user-provided input
  • use secure coding principles to guard against format string attacks
  • parse and check input values before using that input in a WebView object
  • restrict access to navigation methods in a WebView object
  • protect against SQL injection by using parameterized and prepared statements
  • recognize best practice in writing methods for Android apps in Java
  • use best practices to name methods in Java for Android
  • use best practices to name getter methods in Java for Android
  • use best practices to name callback methods in Java for Android
  • reduce method complexity in Android apps using Java
  • use Java overloaded methods to reduce complexity in Java for Android
  • recognize how constants can be used in defensive programming
  • create and use constants in Java for Android
  • use best practices for naming constants in Java for Android
  • create and use resource files in an Android app
  • recognize how to write if statements defensively to protect against potential bugs
  • design while loops that are not vulnerable to running forever
  • design for loops that are not vulnerable to running forever
  • identify and avoid bugs caused by altered loop variables
  • use defensive practices to code in Java

Overview/Description
Defensive Programming in Android aims to use coding practices and techniques to create apps that are reliable and resilient. In this course, you will learn about thinking defensively when creating methods, and also when working with inputs to your programs.

Target Audience
Android developers who have experience creating apps using Java, and who want to employ defensive programming techniques

Defensive Programming in Android: Network Access and Java Defensive Techniques

Course Number:
sd_dpfa_a04_it_enus
Lesson Objectives

Defensive Programming in Android: Network Access and Java Defensive Techniques

  • start the course
  • initialize instances of classes safely
  • check for the presence of null to avoid errors
  • design setters to avoid potential errors
  • recognize how to compare two objects in Java avoiding potential errors
  • work safely with the Java switch and case statements
  • use atomic and nonatomic operations in threaded applications
  • use final properties to minimize potential for errors
  • recognize when to use mutable and immutable classes
  • implement a basic enum in Java
  • use enums to reduce the possibility of unexpected input
  • implement an enum with a constructor and recognize the rules for enum constructors
  • implement an interface in an enum
  • create an enum with abstract methods
  • use packages and classes to implement proper encapsulation
  • import packages in Java Android apps
  • use different scopes to implement defensive programming
  • create APKs to run on Android devices
  • create jars for exporting Java code between apps
  • recognize the importance of maintaining a good user experience while accessing the network
  • use AsyncTask to retrieve data asynchronously and preserve user experience
  • use progress reporting to enhance user experience
  • cache retrieved data to enhance user experience
  • transfer large files in the background
  • check network connectivity status in Android apps
  • sanitize data transferred across the network
  • create an Android app to access the network asynchronously

Overview/Description
Defensive Programming in Android uses coding practices and techniques to create apps that are reliable and resilient. This course will teach you some language-specific Java techniques that promote defensive programming when creating Android apps, as well as how to access the network in Android apps in a way that does not affect user experience.

Target Audience
Android developers who have experience creating apps using Java, and who want to employ defensive programming techniques

Defensive Programming in Android: Using Standards

Course Number:
sd_dpfa_a02_it_enus
Lesson Objectives

Defensive Programming in Android: Using Standards

  • start the course
  • recognize how and where standards promote defensive programming
  • identify and use class naming standards in Java
  • identify and use variable naming standards in Java
  • recognize the proper use of comments to make code more readable and maintainable
  • use SQLite prepared statements to protect against SQL attacks
  • recognize how both indentation and whitespace can be used to promote defensive programming
  • use indentation to make source code more readable and maintainable
  • use whitespace to make source code more readable and maintainable
  • recognize what it means to keep code simple and how it makes programs more robust
  • design classes that have a single and defined focus
  • design methods that have a single and defined focus
  • perform refactoring in Java
  • avoid duplicating code in Java Android apps
  • set up dependency management in Apache Maven
  • set up dependency management in Gradle
  • describe the characteristics of Design by Contract
  • use comments to support Design by Contract
  • use preconditions to support Design by Contract
  • use postconditions to support Design by Contract
  • use invariants to support Design by Contract
  • use Design by Contract in Java
  • use Design by Contract in Android
  • create a simple app using Design by Contract principles

Overview/Description
Defensive Programming in Android uses coding practices and techniques to create apps that are reliable, predictable, and resilient. This course will teach you about enforcing standards in the Android apps you create in order to make source code more predictable and maintainable.

Target Audience
Android developers who have experience creating apps using Java, and who want to employ defensive programming techniques

Close Chat Live